package com.weixing.mall.provider.model.vo.report.customer;

import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.weixing.mall.base.constant.GlobalConstant;
import com.weixing.mall.provider.api.model.enums.OrderTypeEnum;
import com.weixing.mall.provider.model.enums.OrderAuditStateEnum;
import com.weixing.mall.provider.model.enums.OrderFromEnum;
import com.weixing.mall.provider.model.enums.OrderStateEnum;
import com.weixing.mall.provider.model.enums.ProductStatusEnum;
import com.weixing.mall.provider.support.excel.EnumConverter.OrderFromConverter;
import com.weixing.mall.provider.support.excel.EnumConverter.OrderStatusConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Date;

/**
 * <p>
 * 订单宽表 用于统计报表
 * </p>
 *
 * @author Small
 * @since 2020-05-07
 */
@Data
@ApiModel(value="CustomerSeckillBonusDetailVo", description="报表明细")
public class CustomerSeckillBonusDetailVo {
    @ApiModelProperty(value = "订单Id")
    @ExcelIgnore
    private Long id;
    @ApiModelProperty(value = "订单金额")
    @ExcelIgnore
    private BigDecimal orderPrice;
    @ApiModelProperty(value = "是否支付（0未支付 1已支付）")
    @ExcelIgnore
    private Integer isPay;
    @ApiModelProperty(value = "订单商品状态（ProductStatusEnum 1待定；4待货；7有现货；10需外采；13内部换货；16断货））")
    @ExcelIgnore
    private ProductStatusEnum itemStatus;
    @ApiModelProperty(value = "货品ID")
    @ExcelIgnore
    private Long productId;
    @ApiModelProperty(value = "商品ID")
    @ExcelIgnore
    private Long goodsId;
    @ApiModelProperty(value = "sku")
    @ExcelIgnore
    private String skuDesp;


    @ApiModelProperty(value = "商品图片")
    private String goodsImg;
    @ExcelProperty("商品图片")
    @ColumnWidth(10)
    private URL goodsImgUrl;
    public void setGoodsImg(String goodsImg) {
        this.goodsImg = goodsImg;
        try {
            if (StrUtil.isNotEmpty(goodsImg)){
                this.goodsImgUrl=new URL(GlobalConstant.IMG_PATH_URL+goodsImg+GlobalConstant.IMG_PATH_URL_SUFFIX);
            }
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
    @ApiModelProperty(value = "货号")
    @ExcelProperty("货号")
    private String goodsSn;
    @ApiModelProperty(value = "商品分类")
    @ExcelProperty("商品分类")
    private String catName;
    @ApiModelProperty(value = "商品名称")
    @ExcelProperty("商品名称")
    private String goodsName;
    @ApiModelProperty(value = "订单类型 1正价订单；2代理商活动订单；3秒杀订单")
    @ExcelProperty("订单类型")
    private OrderTypeEnum orderType;
    @ApiModelProperty(value = "吊牌价")
    @ExcelProperty("吊牌价")
    private BigDecimal marketPrice;
    @ApiModelProperty(value = "零售价格（商城实收价格）")
    @ExcelProperty("零售价格")
    private BigDecimal price;
    @ApiModelProperty(value = "返百分比")
    @ExcelProperty("返百分比")
    private BigDecimal ratio;
    @ApiModelProperty(value = "返还款")
    @ExcelProperty("返还款")
    private BigDecimal amount;
    @ApiModelProperty(value = "数量")
    @ExcelProperty("数量")
    private String quantity;
    @ApiModelProperty(value = "颜色")
    @ExcelProperty("颜色")
    private String color;
    @ApiModelProperty(value = "尺码")
    @ExcelProperty("尺码")
    private String size;
    @ApiModelProperty(value = "身高")
    @ExcelProperty("身高")
    private Integer height;
    @ApiModelProperty(value = "体重")
    @ExcelProperty("体重")
    private BigDecimal weight;
    @ApiModelProperty(value = "客服审核时间---修改")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("客服审核时间")
    private Date auditTime;
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "下单时间")
    @ExcelProperty("下单时间")
    private Date createdTime;
    @ApiModelProperty(value = "下单人")
    @ExcelProperty("下单人")
    private String buyer;
    @ApiModelProperty(value = "所属代理优惠ID")
    @ExcelProperty("所属代理优惠ID")
    @ExcelIgnore
    private String agentSn;
    @ApiModelProperty(value = "下单代理折扣---修改")
    @ExcelProperty("下单代理折扣")
    private BigDecimal discount;
    @ApiModelProperty(value = "非客服上级：除客服以外的代理关系的下单的上级")
    @ExcelProperty("非客服上级")
    private String buyerHigher;
    @ApiModelProperty(value = "所属代理商")
    @ExcelProperty("所属代理商")
    private String agentName;
    @ApiModelProperty(value = "所属经销商")
    @ExcelProperty("所属经销商")
    private String distributorName;
    @ApiModelProperty(value = "所属客服")
    @ExcelProperty("所属客服")
    private String customerName;
    @ApiModelProperty(value = "收货客户姓名")
    @ExcelProperty("收货客户姓名")
    private String contactUser;
    @ApiModelProperty(value = "手机号码")
    @ExcelProperty("手机号码")
    private String contactPhone;
    @ApiModelProperty(value = "收货地址")
    @ExcelProperty("收货地址")
    private String address;
    @ApiModelProperty(value = "下单来源 1客服下单，2代理商下单，3客户下单")
    @ExcelProperty(value = "下单来源",converter = OrderFromConverter.class)
    private OrderFromEnum orderFrom;
    @ApiModelProperty(value = "订单状态（1待付款;4已取消;7已付款/待审核;10,审核中;13;审核完成/待封单;16已封单;19待发货;22已发货;25已完成;28售后中）")
    @ExcelProperty(value = "订单状态",converter = OrderStatusConverter.class)
    private OrderStateEnum orderStatus;
    @ApiModelProperty(value = "订单编号")
    @ExcelProperty("订单编号")
    private String orderSn;
    @ApiModelProperty(value = "支付流水号")
    @ExcelProperty("支付流水号")
    private String outTradeNo;
    @ApiModelProperty(value = "订单识别码/商品码")
    @ExcelProperty("订单识别码")
    private String commodityCode;
    @ApiModelProperty(value = "备注")
    @ExcelProperty("备注")
    private String remark;



    @ApiModelProperty(value = "款号--修改")
    @ExcelIgnore
    private String styleNo;
    @ApiModelProperty(value = "商品分类id")
    @ExcelIgnore
    private Long catId;
    @ApiModelProperty(value = "成本价")
    @ExcelIgnore
    private BigDecimal costPrice;
    @ApiModelProperty(value = "商品状态")
    @ExcelIgnore
    private ProductStatusEnum productStatus;
    @ApiModelProperty(value = "购买人Id")
    @ExcelIgnore
    private Long buyerId;
    @ApiModelProperty(value = "所属客服id")
    @ExcelIgnore
    private Long customerId;
    @ApiModelProperty(value = "所属经销商Id")
    @ExcelIgnore
    private Long distributorId;
    @ApiModelProperty(value = "订单审核状态（OrderAuditStateEnum 1代理商待审核;3代理商审核中；6代理商审核完成客服待审核；9客服审核完成；12客服审核拒绝）")
    @ExcelIgnore
    private OrderAuditStateEnum auditStatus;
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "订单更新时间")
    @ExcelIgnore
    private Date updatedTime;
    @ApiModelProperty(value = "所属代理商Id 所属代理:下单人的直属代理,也有可能是代理自己下的单")
    @ExcelIgnore
    private Long agentId;
}
